Optimal. Leaf size=47 \[ 2 a^2 \sqrt {x}-\frac {4 a b \tanh ^{-1}\left (\cos \left (c+d \sqrt {x}\right )\right )}{d}-\frac {2 b^2 \cot \left (c+d \sqrt {x}\right )}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 47, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.227, Rules used = {4290, 3858,
3855, 3852, 8} \begin {gather*} 2 a^2 \sqrt {x}-\frac {4 a b \tanh ^{-1}\left (\cos \left (c+d \sqrt {x}\right )\right )}{d}-\frac {2 b^2 \cot \left (c+d \sqrt {x}\right )}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3852
Rule 3855
Rule 3858
Rule 4290
Rubi steps
\begin {align*} \int \frac {\left (a+b \csc \left (c+d \sqrt {x}\right )\right )^2}{\sqrt {x}} \, dx &=2 \text {Subst}\left (\int (a+b \csc (c+d x))^2 \, dx,x,\sqrt {x}\right )\\ &=2 a^2 \sqrt {x}+(4 a b) \text {Subst}\left (\int \csc (c+d x) \, dx,x,\sqrt {x}\right )+\left (2 b^2\right ) \text {Subst}\left (\int \csc ^2(c+d x) \, dx,x,\sqrt {x}\right )\\ &=2 a^2 \sqrt {x}-\frac {4 a b \tanh ^{-1}\left (\cos \left (c+d \sqrt {x}\right )\right )}{d}-\frac {\left (2 b^2\right ) \text {Subst}\left (\int 1 \, dx,x,\cot \left (c+d \sqrt {x}\right )\right )}{d}\\ &=2 a^2 \sqrt {x}-\frac {4 a b \tanh ^{-1}\left (\cos \left (c+d \sqrt {x}\right )\right )}{d}-\frac {2 b^2 \cot \left (c+d \sqrt {x}\right )}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.47, size = 93, normalized size = 1.98 \begin {gather*} \frac {-b^2 \cot \left (\frac {1}{2} \left (c+d \sqrt {x}\right )\right )+2 a \left (a c+a d \sqrt {x}-2 b \log \left (\cos \left (\frac {1}{2} \left (c+d \sqrt {x}\right )\right )\right )+2 b \log \left (\sin \left (\frac {1}{2} \left (c+d \sqrt {x}\right )\right )\right )\right )+b^2 \tan \left (\frac {1}{2} \left (c+d \sqrt {x}\right )\right )}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.09, size = 55, normalized size = 1.17
method | result | size |
derivativedivides | \(\frac {2 a^{2} \left (c +d \sqrt {x}\right )+4 a b \ln \left (\csc \left (c +d \sqrt {x}\right )-\cot \left (c +d \sqrt {x}\right )\right )-2 b^{2} \cot \left (c +d \sqrt {x}\right )}{d}\) | \(55\) |
default | \(\frac {2 a^{2} \left (c +d \sqrt {x}\right )+4 a b \ln \left (\csc \left (c +d \sqrt {x}\right )-\cot \left (c +d \sqrt {x}\right )\right )-2 b^{2} \cot \left (c +d \sqrt {x}\right )}{d}\) | \(55\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 52, normalized size = 1.11 \begin {gather*} 2 \, a^{2} \sqrt {x} - \frac {4 \, a b \log \left (\cot \left (d \sqrt {x} + c\right ) + \csc \left (d \sqrt {x} + c\right )\right )}{d} - \frac {2 \, b^{2}}{d \tan \left (d \sqrt {x} + c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 94 vs.
\(2 (41) = 82\).
time = 3.13, size = 94, normalized size = 2.00 \begin {gather*} \frac {2 \, {\left (a^{2} d \sqrt {x} \sin \left (d \sqrt {x} + c\right ) - a b \log \left (\frac {1}{2} \, \cos \left (d \sqrt {x} + c\right ) + \frac {1}{2}\right ) \sin \left (d \sqrt {x} + c\right ) + a b \log \left (-\frac {1}{2} \, \cos \left (d \sqrt {x} + c\right ) + \frac {1}{2}\right ) \sin \left (d \sqrt {x} + c\right ) - b^{2} \cos \left (d \sqrt {x} + c\right )\right )}}{d \sin \left (d \sqrt {x} + c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 5.03, size = 88, normalized size = 1.87 \begin {gather*} \begin {cases} \frac {2 a^{2} \left (c + d \sqrt {x}\right ) - 4 a b \log {\left (\cot {\left (c + d \sqrt {x} \right )} + \csc {\left (c + d \sqrt {x} \right )} \right )} - 2 b^{2} \cot {\left (c + d \sqrt {x} \right )}}{d} & \text {for}\: d \neq 0 \\- \sqrt {x} \left (- 2 a^{2} - 4 a b \csc {\left (c \right )} - 2 b^{2} \csc ^{2}{\left (c \right )}\right ) & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 83 vs.
\(2 (41) = 82\).
time = 0.44, size = 83, normalized size = 1.77 \begin {gather*} \frac {2 \, {\left (d \sqrt {x} + c\right )} a^{2} + 4 \, a b \log \left ({\left | \tan \left (\frac {1}{2} \, d \sqrt {x} + \frac {1}{2} \, c\right ) \right |}\right ) + b^{2} \tan \left (\frac {1}{2} \, d \sqrt {x} + \frac {1}{2} \, c\right ) - \frac {4 \, a b \tan \left (\frac {1}{2} \, d \sqrt {x} + \frac {1}{2} \, c\right ) + b^{2}}{\tan \left (\frac {1}{2} \, d \sqrt {x} + \frac {1}{2} \, c\right )}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.15, size = 111, normalized size = 2.36 \begin {gather*} 2\,a^2\,\sqrt {x}-\frac {b^2\,4{}\mathrm {i}}{d\,\left ({\mathrm {e}}^{c\,2{}\mathrm {i}+d\,\sqrt {x}\,2{}\mathrm {i}}-1\right )}-\frac {4\,a\,b\,\ln \left (-\frac {a\,b\,4{}\mathrm {i}}{\sqrt {x}}-\frac {a\,b\,{\mathrm {e}}^{d\,\sqrt {x}\,1{}\mathrm {i}}\,{\mathrm {e}}^{c\,1{}\mathrm {i}}\,4{}\mathrm {i}}{\sqrt {x}}\right )}{d}+\frac {4\,a\,b\,\ln \left (\frac {a\,b\,4{}\mathrm {i}}{\sqrt {x}}-\frac {a\,b\,{\mathrm {e}}^{d\,\sqrt {x}\,1{}\mathrm {i}}\,{\mathrm {e}}^{c\,1{}\mathrm {i}}\,4{}\mathrm {i}}{\sqrt {x}}\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________